package com.smartticket.jeju.repository;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.core.support.JdbcDaoSupport;
import org.springframework.stereotype.Repository;

import com.smartticket.jeju.model.Ticket;

public class TicketRepositoryImpl 
{
	@Autowired
	private JdbcDaoSupport jdbcDaoSupport;
	
	@Autowired
	@Qualifier("ticketRowMapper")
	private RowMapper<Ticket> rowMapper;
	
	public List<Ticket> findAll() 
	{
		return jdbcDaoSupport.getJdbcTemplate().query("select * from tickets", rowMapper);
	}
}
